(function () {
    axios.get('http://127.0.0.1:8092/getGrade', {}).then((response) => {
        var myData = []
        var i = 0;
        for (var key in response.data) {
            console.log(key)
            myData[i] = response.data[key]
            i++
        }
        var myChart = echarts.init(document.getElementById('chartSpecialist'))
        option = {
            tooltip: {},
            series: [
                {
                    name: '数量',
                    type: 'pie',
                    radius: [40, 60],
                    center: ['50%', '45%'],
                    // roseType: 'area',
                    data: myData,
                    itemStyle: {
                        normal: {
                            label: {
                                show: true,
                                formatter: '{c}({d}%)'
                            },
                            color: function (colors) {
                                var colorList = [
                                    '#00A3FF',
                                    '#7F6FA1',
                                    '#F8EBFF',
                                    '#66BAA7',
                                    '#87CEFA',
                                    '#00BFFF',
                                    '#B0E0E6',
                                    '#BA55D3',
                                    '#00BFFF',
                                    '#48D1CC',
                                    '#00FFFF',
                                    '#8A2BE2',
                                    '#BA55D3',
                                    '#EE82EE',
                                    '#FF69B4',
                                    '#75bedc'
                                ];
                                return colorList[colors.dataIndex];
                            }
                        }
                    }
                }
            ]
        };
        myChart.setOption(option)
    })
})()
